import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { resolve } from "path";
import fs from "fs";

// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      "@": resolve(__dirname, "src"),
    },
  },
  server: {
    https: {
      key: fs.readFileSync(
        resolve(__dirname, "./public/cert/192.168.0.100-key.pem")
      ),
      cert: fs.readFileSync(
        resolve(__dirname, "./public/cert/192.168.0.100.pem")
      ),
    },
    host: "0.0.0.0",
  },
});
